package cn.edu.cqytxy.common;

/**
 * 售票窗口1
 *
 * @author yinjw
 */
public class Store implements Runnable {

    /**
     * 车票总数 100
     */
    static int num = 100;


    @Override
    public void run() {
        // 车票售卖
        synchronized (this) {
            if (num > 0) {
                System.out.println(Thread.currentThread().getName()
                        + "当前售卖第：" + num + "张");
                num--;
            }
        }
    }

}
